//
//  PallaTabarViewController.m
//  SITABLE
//
//  Created by songjun on 16/9/18.
//  Copyright © 2016年 Sita. All rights reserved.
//

#import "PallaTabarViewController.h"

@interface PallaTabarViewController ()

@end

@implementation PallaTabarViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    //tab0
    FirstViewController *firsPageVc =[[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"firstVc"];
    UINavigationController *firsPageNc = [[UINavigationController alloc] initWithRootViewController:firsPageVc];
    
    //tab1
    Tab1ViewController *analysisVc = [[UIStoryboard storyboardWithName:@"Tab1" bundle:nil] instantiateViewControllerWithIdentifier:@"tab1Vc"];
    UINavigationController *analysisNc = [[UINavigationController alloc] initWithRootViewController:analysisVc];

    //tab2
    Tab2ViewController *interActionVc = [[UIStoryboard storyboardWithName:@"Tab2" bundle:nil] instantiateViewControllerWithIdentifier:@"tab2Vc"];
    UINavigationController *interActionNc = [[UINavigationController alloc] initWithRootViewController:interActionVc];

    //tab3
    Tab3ViewController *setUVc =[[UIStoryboard storyboardWithName:@"Tab3" bundle:nil] instantiateViewControllerWithIdentifier:@"tab3Vc"];
    UINavigationController *setUpNc = [[UINavigationController alloc] initWithRootViewController:setUVc];

    
    NSArray *vcsArr = [NSArray arrayWithObjects:firsPageNc, analysisNc,interActionNc,setUpNc, nil];
    self.viewControllers = vcsArr;
    NSArray *items = self.tabBar.items;

    UITabBarItem *firsPageYadeaItem = items[0];
    [firsPageYadeaItem setTitle:NSLocalizedStringFromTable(@"PallaBike", @"InfoPlist", nil)];
    
    firsPageYadeaItem.image = [[UIImage imageNamed:@"tab0UnS"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    firsPageYadeaItem.selectedImage =[[UIImage imageNamed:@"tab0S"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    
    UITabBarItem *analysisPageYadeaItem = items[1];
    [analysisPageYadeaItem setTitle:NSLocalizedStringFromTable(@"Trip", @"InfoPlist", nil)];
    analysisPageYadeaItem.image = [[UIImage imageNamed:@"tab1UnS"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    analysisPageYadeaItem.selectedImage =[[UIImage imageNamed:@"tab1S"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    
    UITabBarItem *interActionYadeaItem = items[2];
    [interActionYadeaItem setTitle:NSLocalizedStringFromTable(@"Safe", @"InfoPlist", nil)];
    interActionYadeaItem.image = [[UIImage imageNamed:@"tab2UnS"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    interActionYadeaItem.selectedImage =[[UIImage imageNamed:@"tab2S"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    
    UITabBarItem *setupYadeaItem = items[3];
    [setupYadeaItem setTitle:NSLocalizedStringFromTable(@"Mine", @"InfoPlist", nil)];
    setupYadeaItem.image = [[UIImage imageNamed:@"tab3UnS"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    setupYadeaItem.selectedImage =[[UIImage imageNamed:@"tab3S"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    
    [[UITabBar appearance] setTranslucent:NO];
    self.tabBar.tintColor = UIColorHexRGBA(linBoardNavitagionColor, 1.0);
    self.delegate = self;
    
    //[self.tabBar setBackgroundImage:[UIImage imageNamed:@"tabBarBg"]];
}

#pragma mark ----tabar代理方法----
- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController
{
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
